﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class PlatForm : System.Web.UI.Page
{
	private PX.Expert.ExpertComponent clsExpertComp = new PX.Expert.ExpertComponent();

	protected override void OnInit(EventArgs e)
	{
		base.OnInit(e);

		LbExpertOne.Click += new EventHandler(LbExpertOne_Click);
		LbExpertTwo.Click += new EventHandler(LbExpertTwo_Click);
	}

	void LbExpertTwo_Click(object sender, EventArgs e)
	{
		MvExpert.SetActiveView(ViewExpertTwo);
	}

	void LbExpertOne_Click(object sender, EventArgs e)
	{
		MvExpert.SetActiveView(ViewExpertOne);
	}

	protected void Page_Load(object sender, EventArgs e)
	{
		QueryAllExpertOne();
		QueryAllExpertTwo();
	}

	/// <summary>
	/// 查询所有博士后专家
	/// </summary>
	/// <![CDATA[2014-05-05 15:24]]>
	private void QueryAllExpertOne()
	{
		List<PX.Expert.Expert> listExpertOne = new List<PX.Expert.Expert>();

		listExpertOne = clsExpertComp.QueryExpertOne();

		for (int i = 0; i < listExpertOne.Count; i++)
		{
			Panel panelExpert = new Panel();
			Image imageExpert = new Image();
			Literal litIntroduction = new Literal();
			TextBox tbIntroduction = new TextBox();

			imageExpert.ImageUrl = "ShowImage.aspx?FileID=" + listExpertOne[i].ImageID;
			imageExpert.Width = 100;
			imageExpert.Height = 80;

			litIntroduction.Text = "<iframe src = 'ShowFile.aspx?FileID="+listExpertOne[i].IntroductionID.ToString()+"'>";

			tbIntroduction.TextMode = TextBoxMode.MultiLine;
			tbIntroduction.Text = listExpertOne[i].Introduction;

			panelExpert.CssClass = "divPlatFormExpert";

			panelExpert.Controls.Add(imageExpert);
			//panelExpert.Controls.Add(litIntroduction);
			panelExpert.Controls.Add(tbIntroduction);

			ViewExpertOne.Controls.Add(panelExpert);
		}
	}

	/// <summary>
	/// 查询所有技能大师
	/// </summary>
	/// <![CDATA[2014-05-05 16:24]]>
	private void QueryAllExpertTwo()
	{
		List<PX.Expert.Expert> listExpertTwo = new List<PX.Expert.Expert>();

		listExpertTwo = clsExpertComp.QueryExpertTwo();

		for (int i = 0; i < listExpertTwo.Count; i++)
		{
			Panel panelExpert = new Panel();
			Image imageExpert = new Image();
			Literal litIntroduction = new Literal();
			TextBox tbIntroduction = new TextBox();

			imageExpert.ImageUrl = "ShowImage.aspx?FileID=" + listExpertTwo[i].ImageID;
			imageExpert.Width = 100;
			imageExpert.Height = 80;

			litIntroduction.Text = "<iframe src = 'ShowFile.aspx?FileID=" + listExpertTwo[i].IntroductionID.ToString() + "'>";

			tbIntroduction.TextMode = TextBoxMode.MultiLine;
			tbIntroduction.Text = listExpertTwo[i].Introduction;

			panelExpert.CssClass = "divPlatFormExpert";

			panelExpert.Controls.Add(imageExpert);
			//panelExpert.Controls.Add(litIntroduction);
			panelExpert.Controls.Add(tbIntroduction);

			ViewExpertTwo.Controls.Add(panelExpert);
		}
	}
}
